package v1

var (
	// common errors
	ErrSuccess             = newError(200, "ok")
	ErrBadRequest          = newError(400, "Bad Request")
	ErrUnauthorized        = newError(401, "Unauthorized")
	ErrNotFound            = newError(404, "Not Found")
	ErrInternalServerError = newError(500, "Internal Server Error")

	// more biz errors
	ErrEmailAlreadyUse = newError(1001, "The email is already in use.")
	ErrNoStartService = newError( 217, "未开启代驾服务，不能更新位置信息")
	ErrNotAuth = newError( 218, "用户未完成认证")
	ErrFace = newError( 219, "当日未进行人脸识别")
	ErrRobNewOrderFail = newError( 217, "抢单失败")
	ErrIllegalRequest = newError(205, "非法请求")
	ErrDataError = newError(204, "数据异常")
	ErrImageAuditFail = newError( 220, "图片审核不通过")
	ErrUpdateOrderFail = newError( 217, "更新订单失败")
	ErrStartLocationDistance = newError(221, "当前位置与代驾起始位置的确认距离过近")
	ErrEndLocationDistance = newError(222, "当前位置与代驾结束位置的确认距离过近")
	ErrOrderStatusError = newError(223, "订单状态错误")
	ErrOrderPaymentInfoErr = newError(224, "支付单未找到")

)

const (
	IllegalRequest = 205
	 StatusServiceErr = 217	// 执行失败
	 AuthErr = 218 // 用户未完成认证
	 FaceErr = 219
	DataError = 204
	AuditErr = 220
)

// 应该把内置错误码和新增错误码统一起来，目前返回错误的时候还不太好处理

var ErrMap = map[int]error{
	StatusServiceErr: ErrNoStartService,
	AuthErr: ErrNotAuth,
	FaceErr: ErrFace,
}
